package com.dgut.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dgut.cache.MybatisRedisCache;
import com.dgut.pojo.IntellectualProperty;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@CacheNamespace(implementation = MybatisRedisCache.class,eviction=MybatisRedisCache.class)
public interface IntellectualPropertyMapper extends BaseMapper<IntellectualProperty> {
    /**
     *start-lzh
     */
    //上架知识产权商品
    @Update("update intellectual_property set state = #{ON} where id =#{id};")
    public void StackIntellectualProperty(Integer id,String ON);


    //下架知识产权商品
    @Update("update intellectual_property set state = #{OFF} where id = #{id};")
    public void UndercarriageIntellectualProperty(Integer id,String OFF);

    //显示上架的知识产权商品
    @Select("select * from intellectual_property where state = #{ON};")
    public List<IntellectualProperty> SelectONIntellectualProperty(String ON);
    /**
     *end-lzh
     */
}
